package com.nft.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author hq
 * @date: 2022/10/21 16 15 17
 * 短信验证码模板
 */
@AllArgsConstructor
@Getter
public enum CodeTemplateEnum {
    REGISTER(1, "1563945", "注册"),
    LOGIN(2, "1574857", "登录"),
    UPDATE_PAY_PASSWORD(3, "1581305", "修改支付密码"),
    REAL_NAME(4,"1581544","实名认证"),
    CONSIGN_FOR_SALE(5,"1585839","寄售"),
    GIVE(6,"1588128","赠送"),


    ;

    /**
     * 类型
     */
    private int type;

    /**
     * 模板id
     */
    private String templateId;

    /**
     * 描述
     */
    public String describe;

    public static String getEumByCode(int type) {
        for (CodeTemplateEnum enumItem : CodeTemplateEnum.values()) {
            if (enumItem.getType() == type) {
                return enumItem.getTemplateId();
            }
        }
        return null;
    }

}
